%h1 Menu Items
- @menu_items.each do |menu_item|
  %table.menu_item
    - form_for menu_item, :method => :update do |form|
      = error_messages_for  :menu_item
      %tr
        %td.field_title Menu item:
        %td.field= form.text_field :item
        %td.field_title links to:
        %td.field= form.text_field   :link
      %tr
        %td
        %td.error= error_message_on :menu_item, :item
        %td
        %td.error= error_message_on :menu_item, :link
      %tr
        %td
        %td.submit= submit_tag 'update ' + menu_item.item
    - form_for menu_item, :html => {:method => 'delete'} do |form|
      %tr
        %td
        %td.submit= submit_tag 'delete ' + menu_item.item
- form_for @menu_item, :method => :put do |form|
  %table.new_menu_item
    %tr
      %td.title{:colspan => 2} Add a new Menu Item
    %tr
      %td.field_title Menu item:
      %td.field= form.text_field :item
      %td.error= error_message_on :menu_item, :item
    %tr
      %td.field_title Links to:
      %td.field= form.text_field   :link
      %td.error= error_message_on :menu_item, :link
    %tr
      %td
      %td{:valign => "top"}= submit_tag 'add'